package com.lanyuan.thrid.wechat.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class PayUtil {

	/**
	 * 生成支付JS请求JSON
	 * 
	 * @return
	 */
	public static Map<String, String> generatePayJsRequestJson(Map<String, String> map, String prepay_id) {
		Map<String, String> payMap = new HashMap<String, String>();
		payMap.put("appId", Constants.APPID);
		payMap.put("timeStamp", String.valueOf(System.currentTimeMillis()));
		payMap.put("nonceStr", UUID.randomUUID().toString().replaceAll("-", ""));
		payMap.put("signType", "MD5");
		payMap.put("package_", "prepay_id=" + prepay_id);
		payMap.put("paySign", SignatureUtil.generateSign(map, Constants.KEY));
		return payMap;
	}

}